class AcademicSpace < ActiveRecord::Base
  belongs_to :academic_space_type, :include => :academic_space_type

  has_many :academic_space_services
  has_many :services, :through => :academic_space_services
  has_many :group_spaces
  has_many :groups, :through => :group_spaces

  validates_presence_of :name, :abbreviation, :capacity, :academic_space_type_id
  validates_uniqueness_of :name, :abbreviation
  validates_numericality_of :capacity, :only_integer => true, :greater_than => 0
end
